local sk__jiejun = fk.CreateSkill {

  name = "sk__jiejun",

  tags = {  },

}



sk__jiejun:addEffect(fk.CardUseFinished, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(sk__jiejun.name) and player.phase == Player.NotActive and target ~= player and not target.dead and
      data.card.color == Card.Red
  end,
  on_cost = function (self, event, target, player, data)
    local use = player.room:askForUseCard(player, "slash", "slash",
      "#sk__jiejun-invoke::"..target.id, true, {bypass_distances = true, bypass_times = true, must_targets = {target.id}})
    if use then
      event:setCostData(self, use)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local use = event:getCostData(self)
    use.extraUse = true
    room:useCard(use)
    if not player.dead and not target.dead and not target:isNude() and use.damageDealt and use.damageDealt[target] then
      local cardIds = target:getCardIds("he")
      room:moveCardTo(cardIds, Card.PlayerHand, player, fk.ReasonPrey, sk__jiejun.name, nil, false, player)
    end
  end,
})

return sk__jiejun